package com.sport.util;

import android.content.Context;
import android.view.Gravity;
import android.widget.Toast;

//Toast统一响应体
public class ToastUtil {

    public static void toastShort(Context context, String msg) {
        Toast toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);
        // 设置Toast显示在屏幕正中间
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();
    }

    public static void toastLong(Context context, String msg) {
        Toast toast = Toast.makeText(context, msg, Toast.LENGTH_LONG);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();
    }
}
